Add more error handling
authorAaron Schulz <aaron@users.mediawiki.org>
Sun, 7 Sep 2008 00:38:57 +0000 (00:38 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sun, 7 Sep 2008 00:38:57 +0000 (00:38 +0000)
includes/filerepo/FileRepo.php

index 23a132e..02d0d1f 100644 (file)
@@ -101,7 +101,7 @@ abstract class FileRepo {
                # Now try an old version of the file
                if ( $time !== false ) {
                        $img = $this->newFile( $title, $time );
-                       if ( $img->exists() ) {
+                       if ( $img && $img->exists() ) {
                                if ( !$img->isDeleted(File::DELETED_FILE) ) {
                                        return $img;
                                } else if ( ($flags & FileRepo::FIND_PRIVATE) && $img->userCan(File::DELETED_FILE) ) {